package com.user.dao;

import com.user.entity.BookInfo;
import com.user.entity.Users;

import java.util.List;

public interface IUserdao {

    //用户登录
    boolean userLogin(Users users);

    //用户注册
    boolean userRegister(Users users);

    //用户名是否存在
    boolean queryUsernameIsExist(Users users);

    //学校号是否存在
    boolean querySchoolidIsExist(Users users);

    //所有书籍列表
    List<BookInfo> bookList();

    //书籍分页
    List<BookInfo> queryBookInfoByPage(int currentPage, int pageSize);

    //书籍总数
    int getBookInfoTotalCount();

    //借阅总数
    int getBorrowBooksTotalCount(String username);

    //根据用户名获得id
    int getIdByUsername(String username);

    //根据用户名获得密码
    String getPasswordByUsername(String username);

    //用户借阅书籍
    boolean borrowBooks(Users users, BookInfo bookInfo);

    //为userbooks表添加数据
    boolean UserBorrowBooks(int id, BookInfo bookInfo);

    //用户还书
    boolean returnBooks(Users users, BookInfo bookInfo);

    //书籍数量增加
    boolean addBook(BookInfo bookInfo);

    //书籍的数量减少
    boolean reduceBook(BookInfo bookInfo);

    //用户借阅书籍数
    List<BookInfo> usersBooks(Users users);

    //模糊查询书籍
    List<BookInfo> queryBooksByCondition(BookInfo bookInfo);


    //用户更改密码
    boolean changeUserPassword(Users users);

}
